﻿using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;

namespace SuperListEx
{
    public class GraphicsSettings
    {
        private Graphics _grfx;
        private StringFormat _format;

        public GraphicsSettings(Graphics grfx)
        {
            if (grfx == null)
            {
                throw new ArgumentNullException("grfx");
            }

            _grfx = grfx;
        }

        public Graphics Graphics
        {
            get
            {
                return _grfx;
            }
        }

        public StringFormat DefaultStringFormat
        {
            get
            {
                if (_format == null)
                {
                    _format = new StringFormat(StringFormat.GenericDefault);
                    _format.Trimming = StringTrimming.EllipsisCharacter;
                    _format.LineAlignment = StringAlignment.Near | StringAlignment.Center;
                    _format.Alignment = StringAlignment.Near;
                    _format.FormatFlags = StringFormatFlags.NoWrap;
                }
                return _format;
            }
        }
    }
}
